package org.codingq92.frame.spring.clazz;

import org.codingq92.frame.spring.ann.CusAutowired;
import org.codingq92.frame.spring.ann.CusComponent;
import org.codingq92.frame.spring.ann.CusPostConstruct;
import org.springframework.stereotype.Component;

@Component
@CusComponent(name = "fatherClass")
public class FatherClass {

    @CusAutowired
    private SonClass sonClass;

    //    @CusAutowired
    @CusAutowired(required = false) // 不写required属性，默认为true 那么扫描创建bean就会报错
    private SonClassNoAnn sonClass2;

    @CusPostConstruct
    public void print() {
        System.out.println("FatherClass>> 属性>>>" + sonClass);
    }
}
